package com.wing.product.model.response;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.wing.bill.model.enums.OrderSourceEnum;
import com.wing.bill.model.enums.ShipmentOrderStatusEnum;
import com.wing.bill.model.enums.SignOrderStatusEnum;
import com.wing.mybatis.common.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

@Schema(description="托管订单（签收）")
@Data
@EqualsAndHashCode(callSuper=true)
@TableName(value = "warehouse_sign_order")
public class WarehouseSignOrderVO extends BaseEntity<WarehouseSignOrderVO> {

    private String shipmentOrderCode; // 发货订单编号
    private String waybill; // 运单号
    private String orderCode; // 订单编号
    private Integer totalQuantity; // 总数量
    private String customerId; // 客户 ID
    private Double totalWeight; // 总重量
    private Double totalNetWeight; // 总重量
    private Double signQuantity;
    private Double totalGrossWeight; // 总毛量
    private String status; // 状态
    private LocalDateTime storeTime; // 签收时间
    private String customerName;
    private Long orderId;
    private String signCode;
    private Long shipmentOrderId;
    private String customerCode;//客户编码

    private String sourceDesc;
    //如果签收了，此值不为空
    private String storageId;

    private LocalDateTime priceTime;

    public void setOrderStatus(String orderStatus) {
        this.orderStatus = orderStatus;
        this.orderStatus = SignOrderStatusEnum.getDescByCode(orderStatus);
    }

    private Integer source;

    private String orderStatus;

    public void setSource(Integer source){
        this.source = source;
        this.sourceDesc = OrderSourceEnum.getDescByCode(source);
    }
}
